package com.dkcrow.spring.transaction;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.dkcrow.spring.transaction.service.UserServiceImpl;

/**
 * Hello world!
 *
 */
public class DupTransactionApp
{
	final static Logger logger = LoggerFactory.getLogger(DupTransactionApp.class.getClass());
	
    public static void main( String[] args )
    {
    	ApplicationContext ap = new ClassPathXmlApplicationContext("spring/*-jdbc-context.xml");
    	
    	UserServiceImpl userServiceImpl = (UserServiceImpl) ap.getBean("userServiceImpl");
    	userServiceImpl.deleteAllUser();

    	/**
    	 * data source 2개에서 transaction 설정.
    	 */

    	userServiceImpl.excuteDup();
    }
}
